<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'display';
$upticket=array('未通知注册','通知注册成功','通知注册失败');
if($_RQ['op']=='display'){
	$return['item']=$this->plugin_setting('basic');
	$return['item']['upticket']=$return['item']['upticket']?:0;
	$return['item']['upticket']=$upticket[$return['item']['upticket']];
	$return['item']['apiurl']=SITEROOT.'addons/jy_mayitwc/api.php?id='.$_SESSION['uniacid'];
	$htmls=array(
		'type'=>'look',
		'desc'=>'回调事件',
		'tabs'=>array(
			array('op'=>'display','title'=>'回调事件'),
		),
		'look'=>array(
				array('type'=>'tip','title'=>'
				【温馨提示】：租赁⽅、融资⽅、清分机构需要在蚂蚁区块链注册需要回调服务，否则默认不回调该机构。当某一方对订单内容更新后，相关⽅会收到通知系统的回调。此处需要额外注意的是，若对应回调服务失败时，通知系统会按照配置默认回调⼀定次数，超过尝试回调的最⼤次数则会放弃回调。⽬前的策略如下：尝试回调的最⼤次数定义10次 每次回调的间隔为2分钟，4分钟，8分钟，16分钟…
				</br>1、https://antchain.antgroup.com/docs/11/190781
				'),
				array('type'=>'copy','title'=>'回调地址','name'=>'apiurl'),
				array('type' =>'post','name'=>'upticket','op'=>'upticket','title' =>'通知注册','btntitle'=>'点击注册'),
		)
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='upticket'){
	$open=core_setting('open');
	$basic=$this->plugin_setting('basic');
	$basic['upticket']=2;
	$this->plugin_setting('basic',$basic);
	$res=$this->model('model')->upticket();
	$basic=$this->plugin_setting('basic');
	$basic['upticket']=1;
	$this->plugin_setting('basic',$basic);
	exi('注册成功！');
}